We show that a function f:X→R\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$f: X \\rightarrow {\\mathbb {R}}$$\\end{document} defined on a closed uniformly polynomially cuspidal set X in Rn\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$${\\mathbb {R}}^n$$\\end{document} is real analytic if and only if f is smooth and all its composites with germs of polynomial curves in X are real analytic. The degree of the polynomial curves needed for this is effectively related to the regularity of the boundary of X. For instance, if the boundary of X is locally Lipschitz, then polynomial curves of degree 2 suffice. In this Lipschitz case, we also prove that a function f:X→R\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$f: X \\rightarrow {\\mathbb {R}}$$\\end{document} is real analytic if and only if all its composites with germs of quadratic polynomial maps in two variables with images in X are real analytic; here it is not necessary to assume that f is smooth.